package com.lw.chat.server.service;

import java.util.HashMap;
import java.util.Map;

public class UserServiceMemoryImpl implements UserService{

    private Map<String,String> allUserMap = new HashMap<>();
    {
        allUserMap.put("zhangsan","123");
        allUserMap.put("Lisi","123");
        allUserMap.put("wangwu","123");
        allUserMap.put("zhaoliu","123");
        allUserMap.put("qianqi","123");
    }

    @Override
    public boolean login(String username, String password) {
        String pwd = allUserMap.get(username);
        if(pwd==null) return false;

        return pwd.equals(password);
    }
}
